import request from '@/utils/request'
import qs from 'qs'

/**
 * 获取列表
 * @param limit
 * @param offset
 */
export function getTable7List(id) {
  return request({
    url: '/system/tableSeven/getTable7List',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}

/**
 * 编辑或保存
 * @param id
 * @param name
 * @param imgJson
 * @param showState
 */
export function addOrEdit(id,
                          tableOneId,
                          cyrq,
                          fxrq,
                          type,
                          table1Json,
                          jyyq,
                          fxr,
                          jdr,
                          yqbh,
                          jcxm) {
  return request({
    url: '/system/tableSeven/addOrEdit',
    method: 'post',
    dataType: 'JSON',
    contentType : 'application/json',
    data: qs.stringify({
      id,
      tableOneId,
      cyrq,
      fxrq,
      type,
      table1Json,
      jyyq,
      fxr,
      jdr,
      yqbh,
      jcxm
    })
  })
}

/**
 * 删除
 * @param id
 */
export function del(id) {
  return request({
    url: '/system/tableSeven/del',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}

export function getInfo(id, table1Id) {
  return request({
    url: '/system/tableSeven/getInfo',
    method: 'post',
    data: qs.stringify({
      id, table1Id
    })
  })
}
